require(["common","jQuery","coAjax","queryString","href","hash_routie"],function(jSouper,$,coAjax,QueryString,href,hash_routie){
	var queryString = new QueryString();
	var goods_id = queryString.get("id");
	coAjax.get(appConfig.user.can_eval+goods_id,function (result) {
		App.set("$Cache.eval.can_evaluation_able",result.result.can_evaluation_able);
	});
	App.set("$Event.eval.submitEval",function () {
		var evaluationData = App.get("$Cache.eval");
		if (!$.trim(evaluationData.content)) {
			alert("warn","请输入评价内容");
			return;
		}
		coAjax.post(appConfig.user.add_eval+goods_id,evaluationData,function (result) {
			evaluations = App.get("goods_detail.evaluations");
			evaluations.unshift(result.result);
			App.set("goods_detail.evaluations",evaluations);
			App.set("$Cache.eval.can_evaluation_able",false);
		});
	});
});